# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=xapian-core
pkgver=1.4.18
pkgrel=1
epoch=1
pkgdesc='Open source search engine library.'
arch=('x86_64')
url="https://www.xapian.org/"
license=('GPL2')
makedepends=('util-linux')
depends=('bash' 'gcc-libs' 'glibc' 'zlib')
provides=('libxapian.so')
# xapian config requires libxapian.la
options=('libtool')
source=("https://oligarchy.co.uk/xapian/${pkgver}/${pkgname}-${pkgver}.tar.xz"{,.asc})
sha512sums=('ba6240054c0d2f92b9f1059aa934cdf35388ee7c7e05f4ef6f9856bdaed8ad821095a348ed9a892afdf18c3c0ad20e163028ad0ed3a9934bd69b861e814678ef'
            'SKIP')
b2sums=('e5d680578e0a4605a8e99470921fba29cdd3d137d017608b8bf571951726055d2a1d49e9649829f0df92af3d27d0565f90baaca5a4eb5c67cb368f5d1e592d28'
        'SKIP')
validpgpkeys=('08E2400FF7FE8FEDE3ACB52818147B073BAD2B07') # Olly Betts <olly@debian.org>

prepare() {
  cd "${pkgname}-${pkgver}"
  autoreconf -vfi
}

build() {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr
  make
}

check() {
  cd "${pkgname}-${pkgver}"
  make check
}

package() {
  depends+=('libuuid.so')
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
  install -vDm 644 {AUTHORS,ChangeLog,HACKING,NEWS,README} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
